package com.demo.service.impl;

import com.demo.entity.Video;
import com.demo.mapper.VideoMapper;
import com.demo.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VideoServiceImpl implements VideoService {
    @Autowired
    private VideoMapper videoMapper;

    @Override
    public List<Video> selectAllVideos() {
        return videoMapper.selectAllVideos();
    }

    @Override
    public Video selectVideoById(int id) {
        return videoMapper.selectVideoById(id);
    }

    @Override
    public Boolean deleteVideoById(int id) {
        return videoMapper.deleteVideoById(id) > 0;
    }

    @Override
    public Boolean insertVideo(Video video) {
        return videoMapper.insertVideo(video) > 0;
    }

    @Override
    public Boolean updateVideo(Video video) {
        return videoMapper.updateVideo(video) > 0;
    }
}
